package com.tangyuan.user.controller;

import com.tangyuan.aspect.AutoLog;
import com.tangyuan.common.result.Result;
import com.tangyuan.common.util.CommStatus;
import com.tangyuan.model.activity.PollRecord;
import com.tangyuan.user.service.IPollRecordService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: poll_record
 * @Author: jeecg-boot
 * @Date: 2024-03-20
 * @Version: V1.0
 */
@Api(tags = "poll_record")
@RestController
@RequestMapping("/user/pollRecord")
@Slf4j
public class PollRecordController {
    @Autowired
    private IPollRecordService pollRecordService;

    @AutoLog("给用户投票")
    @GetMapping("/getPollByUserId")
    public Result<Object> getPollByUserId(@RequestHeader(name = "userId", required = false) Long userId, PollRecord pollRecord) {
        return pollRecordService.getPollByUserId(userId, pollRecord);
    }

}
